/********************************************************************
	file base:	EmbedAndExtract
	file ext:	cpp
	author:		JiangHuai
	
	purpose:	implement the embed and extract function
*********************************************************************/


#include "EmbedAndExtract.h"
#include <string>
#include "Lib/CXImage600/include/ximage.h"

using namespace std;


string Encompress(string toBeEncompressed);
string Decompress(string toBeDecompressed);

int LSBEmbed(Info& infoV);
int LSBExtract(Info& infoV);

string DESEncipher(string toBeEnciphered);
string DESDecipher(string toBeDeciphered);



void Embed() {
	if (info.compress) {
		info.plainText = Encompress(info.plainText);
	}
	switch (info.encryptType)
	{
	case AES:
	case DES:
		info.plainText = DESEncipher(info.plainText);
		break;
	case NONE:
		break;
	}
	switch (info.fileType)
	{
	case CXIMAGE_FORMAT_JPG:
	case CXIMAGE_FORMAT_GIF:
	case CXIMAGE_FORMAT_TIF:
	case CXIMAGE_FORMAT_BMP:
		LSBEmbed(info);
		break;
	}
}

void Extract() {
	if (info.compress) {
		info.plainText = Decompress(info.plainText);
	}
	switch (info.encryptType)
	{
	case AES:
	case DES:
		info.plainText = DESDecipher(info.plainText);
		break;
	case NONE:
		break;
	}
	switch (info.fileType)
	{
	case CXIMAGE_FORMAT_JPG:
	case CXIMAGE_FORMAT_GIF:
	case CXIMAGE_FORMAT_TIF:
	case CXIMAGE_FORMAT_BMP:
		LSBExtract(info);
		break;
	}
}

string Encompress(string toBeEncompressed) {
	return toBeEncompressed;
}

string Decompress(string toBeDecompressed) {
	return toBeDecompressed;
}

string DESEncipher(string toBeEnciphered) {
	return toBeEnciphered;
}

string DESDecipher(string toBeDeciphered) {
	return toBeDeciphered;
}

int LSBEmbed(Info& infoV) {
	return 0;
}

int LSBExtract(Info& infoV) {
	return 0;
}